<html>
<head><meta charset="utf-8"><title>Sharing the lexer between rustc and rust-analyzer · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html">Sharing the lexer between rustc and rust-analyzer</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163363541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163363541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163363541">(Apr 15 2019 at 08:59)</a>:</h4>
<p>Hey, what do folks here think about extracting rustc lexer as an independent library with a nice-ish interface? There's little direct value in this (lexer is simple), but it seems like a low-hanging fruit and an easy first step of librarifiication. </p>
<p>I've posted a PR with a POC interface here: <a href="https://github.com/rust-lang/rust/pull/59706" target="_blank" title="https://github.com/rust-lang/rust/pull/59706">https://github.com/rust-lang/rust/pull/59706</a>. Would love to here feedback on it before making this more production ready.</p>



<a name="163369064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163369064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163369064">(Apr 15 2019 at 10:39)</a>:</h4>
<p>sgtm. we'll need to think about the publishing story though.</p>



<a name="163370855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163370855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163370855">(Apr 15 2019 at 11:15)</a>:</h4>
<p>Given that this should be relatively stable after initial development, and that a single external user initially would be rls2.0, I'd be happy with me just manually publishing the crate. We can scale this up to automatic publishing if needed</p>



<a name="163939357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163939357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163939357">(Apr 22 2019 at 21:20)</a>:</h4>
<p>I've not read the details but I'm <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span> on the idea!</p>



<a name="163939369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163939369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163939369">(Apr 22 2019 at 21:20)</a>:</h4>
<p>Maybe this would make a good thing to discuss at a design meeting?</p>



<a name="163939378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163939378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163939378">(Apr 22 2019 at 21:20)</a>:</h4>
<p>Let me start a list of possible design meeting topics</p>



<a name="163939633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Sharing%20the%20lexer%20between%20rustc%20and%20rust-analyzer/near/163939633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Sharing.20the.20lexer.20between.20rustc.20and.20rust-analyzer.html#163939633">(Apr 22 2019 at 21:23)</a>:</h4>
<p>I created <a href="https://hackmd.io/mHlmaUYMSy2SJ5HgjVoVSg" target="_blank" title="https://hackmd.io/mHlmaUYMSy2SJ5HgjVoVSg">a HackMd document</a> for now</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>